<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // 匹配手机号  11位  1开头

        var reg = /^1\d{10}$/ ;


        // 匹配邮箱   xx@xx.com 
        var reg = /^\w{1,}@\w{1,}\.com$/ ;

        console.log(reg.test('23@qq.com'));


        // 6-12 用户名   数字不能开头，字母数字下划线组成
        var reg = /^[a-zA-Z_]\w{5,11}$/ ;
        console.log(reg.test('12dwfef'));

    </script>
    
</body>
</html>